package com.zzw.hj31;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 单词倒排
 * @Author: zzw
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        char c = ' ';
        StringBuilder sb = new StringBuilder();
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] < 'A' || (chars[i] > 'Z' && chars[i] < 'a') || chars[i] > 'z') {
                chars[i] = c;
            }
            sb.append(chars[i]);
        }
        String[] strArr = String.valueOf(sb).split(" ");
        for (int i = strArr.length - 1; i >= 0; i--) {
            System.out.print(strArr[i] + " ");
        }
    }
}
